<script lang="ts">
import { defineComponent, PropType } from "vue";
import { CompSchema } from "@/components/RenderEngine/index";

export default defineComponent({
  name: "MeiForm",
  props: {
    subSchemas: {
      type: Array as PropType<CompSchema[]>,
    },
  },
  data() {
    return {
      form: {} as any,
    };
  },
});
</script>

<template>
  <el-form :model="form" label-width="80px">
    <component
      v-for="(schema, index) in subSchemas"
      :is="schema.cmpName"
      v-bind="schema"
      :key="index"
      v-model="form[schema.name]"
    ></component>
  </el-form>
</template>

<style scoped lang="scss"></style>
